<template>
    <Modal v-model="visible" title="查验异常信息详情" width="1300" :key="key">
        <div>
            <Form :label-width="100" inline>
                <Form-item label="姓名:">
                    <Input v-model="queryParam.azcp0003" placeholder="" class="itemShortStyle"/>
                </Form-item>
                <Form-item label="证件号码:">
                    <Input v-model="queryParam.azcp0001" placeholder="" class="itemShortStyle"/>
                </Form-item>
                <Form-item label="异常类型:">
                    <dictSelect :sel_val='queryParam.pshr0001' dictCode="warningcategory"
                                :bindData.sync="queryParam.pshr0001" class="itemShortStyle"
                                show-keys="2000,2300,2400,2500,2800,2900,3100,3200,3250,3300,3400,3500,3600,3700"
                                clearable/>
                </Form-item>
                <Form-item label="">
                    <Button type="primary" style="float: right;margin-left: 10px" @click="exportErrorExcel">导出
                    </Button>
                    <Button type="primary" style="float: right;margin-left: 10px" @click="searchReset">重置
                    </Button>
                    <Button type="primary" style="float: right;margin-left: 10px" @click="searchQuery">查询
                    </Button>
                </Form-item>
            </Form>
            <vxe-table border
                       resizable
                       stripe
                       row-id="id"
                       :row-key="true"
                       show-overflow="tooltip"
                       highlight-hover-row
                       align="center"
                       header-align="center"
                       ref="xTree"
                       :loading="Loading"
                       :data="tableData">
                <vxe-table-column field="azcp0003" title="姓名 " align="center" width="120" fixed="left"/>
                <vxe-table-column field="azcp0001" title="证件号码" align="center" width="180" />
                <vxe-table-column field="pshr0001_name" title="异常类型" align="center" width="200" fixed="left"/>
                <vxe-table-column field="pshr0005_name" title="属地区划" align="center" width="220"/>
                <vxe-table-column field="pshr0002" title="异常详情" align="center" width="220"/>
                <vxe-table-column field="pshr0013" title="死亡时间" align="center" width="120" :formatter="renderTime"/>
                <vxe-table-column field="pshr0003" title="查验时间" align="center" width="120" :formatter="renderTime"/>
                <vxe-table-column field="pshr0008" title="处理人" align="center" width="120"/>
                <vxe-table-column field="pshr0009" title="处理时间" align="center" width="120" :formatter="renderTime"/>
                <vxe-table-column field="pshr0006_name" title="例外类型" align="center" width="180"/>
                <vxe-table-column field="pshr0007" title="例外原因" align="center" width="220"/>
            </vxe-table>
            <Page :total="dataCount" :page-size="pageSize" show-total class="paging"
                  @on-change="handleTableChange" :current="pageNo"></Page>
        </div>
        <div slot="footer">
            <Button type="text" size="large" @click="visible = false">关闭</Button>
        </div>
    </Modal>
</template>

<script>
  import { CommonMixin } from '@/views/common/js/CommonMixin'
  import dictSelect from '@/components/dictSelect/dictSelect.vue'
  import DateFormat from '@/plugins/format.js'

  export default {
    mixins: [CommonMixin],
    name: 'exception-show',
    components: {
      dictSelect,
    },
    data () {
      return {
        visible: false,
        title: '查验异常详情信息',
        key: '',
        Loading: false,
        queryParam: {},
        url: {
          list: '/api/ac/subsistence/ss00005Service/handleValidateList',
          exportExcel: '/api/ac/subsistence/ss00005Service/exportErrorExcel',
        },
      }
    },
    methods: {
      edit (row) {
        this.ss18900Id = row.id
        this.queryParam = {}
        this.queryParam.ss18900Id = row.id
        this.loadData(1)
        this.visible = true
      },
      searchReset () {
        this.queryParam = {}
        this.queryParam.ss18900Id = this.ss18900Id
        this.loadData(1)
      },
      cancel () {
        this.queryParam = {}
        this.visible = false
      },
      //导出月度花名册查验例外
      exportErrorExcel () {
        this.exportFileName = '月度花名册例外详情数据'
        this.queryParam.ss18900Id = this.ss18900Id
        this.exportExcel()
      },
    }
  }
</script>

<style scoped>
    .itemShortStyle {
        width: 180px
    }
</style>
